package com.zw.web.controller;

import com.zw.domain.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户提供者服务
 */
@RestController
public class UserController {

    /**
     * 提供者方法，orderServer消费者来调用
     * @param id
     * @return
     */
    // @RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    @GetMapping("/user/{id}")
    public User getUserById(@PathVariable("id")Long id){
        System.out.println("UserProviderController.getUserById被调用了......");
        return new User(id,"zs:"+id , "123 port:1001");
    }
}